package ihm.models.events;

import java.util.EventObject;

import systems.rpgBuilder.Item;

/**
 * This event is use to notify that the item selected in the tree changed.
 * @author Baptiste Legrand & Benjamin Orman
 * @version 1.0
 */
public class ItemTypeChangedEvent
extends EventObject {
  /**
   * Serial Version Value.
   */
  private static final long serialVersionUID = 1L;
  /**
   * The new item selected.
   */
  private Item newItemSelected;

  /**
   * Create an event used to notify that the item selected in the tree
   * has been changed and the new item is given in parameter.
   * @param source - The source of this event
   * @param newItemSelected - The new item selected
   */
  public ItemTypeChangedEvent(Object source, Item newItemSelected)
  {
    super(source);
    this.newItemSelected  = newItemSelected;
  }

  /**
   * Getter returning the new item selected in the tree.
   * @return Item - The new item selected.
   */
  public Item getItemSelected()
  {
    return this.newItemSelected;
  }
}